package com.zdy.utils;

import android.text.TextUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by zhuangdaoyuan on 2018/7/10.
 * 安静撸码，淡定做人
 */
public class CheckUtil {

    public static boolean checkLoginCode(String code) {
//        Pattern pattern = Pattern.compile("[a-zA-z]{4,5}_[0-9]{7}");
//        Matcher isNum = pattern.matcher(code);
//        if( !isNum.matches() ){
//            return false;
//        }
        return !TextUtils.isEmpty(code);
    }

    public static boolean checkLoingPhone(String phone) {
        // TODO: 2018/7/11 验证手机号
        Pattern pattern = Pattern.compile("^1[0-9]{10}$");
        Matcher isNum = pattern.matcher(phone);
        if (!isNum.matches()) {
            return false;
        }
        return true;
    }
}
